#!/bin/sh
set -e

# stash any unstaged changes
git stash push -m "prePush" -q --keep-index

# unstash the unstashed changes (if any) on exit or interrupt
function unstash {
	git stash apply stash^{/prePush} -q || true
}

trap unstash EXIT

./gradlew check test -q
